﻿using DICOMViewer.Utility;
using Leadtools.Dicom;
using qiniu_class.Storage;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.IO;
using System.IO.Compression;
using System.Linq;
using System.Management;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using DICOMViewer.UC;

namespace DICOMViewer
{
    public partial class Formt : Form
    {
        public Formt()
        {
            InitializeComponent();
        }

        private ProgressForm progressForm;

        private void button1_Click(object sender, EventArgs e)
        {
            OpenFileDialog ofDia = new OpenFileDialog();
            ofDia.Title = "请选择需要上传的文件！";
            ofDia.DefaultExt = ".zip";
            ofDia.Filter = "Zip文件|*.zip";
            ofDia.Multiselect = false;
            ofDia.InitialDirectory = Application.StartupPath;
            if (ofDia.ShowDialog() == DialogResult.OK)
            {
                    progressForm = new ProgressForm(FindForm());

                var savePath =@"d:\a.zip";
                ZipFileConverter zipConverter =
                    new ZipFileConverter(ofDia.FileName, savePath, string.Empty, progressForm);
                zipConverter.beginConvert();
                progressForm.ShowDialog();
            }
        }

    }
}